package com.easy.nacos.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Packge com.easy.nacos.config.controller
 * @Autor linNaibin
 * @Description
 * @Version 1.0
 * @Date 2021/3/4 14:14
 */

@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigController {

    @Value("${useLocalCache}")
    private Integer useLocalCache;

    @RequestMapping("/get")
    public Integer get() {
        System.out.println("测试配置中心是否生效。");
        return useLocalCache;
    }

}
